import { get, post } from '@/common/js/httpHelper'
import * as url from '@/common/js/interfaces'

const createSubmissionForm = async (formData) => {
  const result = await post(url.createSubmissionForm, formData)
  return result.data
}

const updateRequestForm = async (formData) => {
  const result = await post(`${url.updateRequestForm}`, formData)
  return result.data
}

const searchSubmissionForm = async (refNo) => {
  const result = await get(`${url.searchSubmissionForm}/${refNo}`)
  return result.data
}

const getRequestFormWithCondition = async (condition) => {
  const result = await post(`${url.requestFormListUrl}`, condition)
  return result.data
}

export default {
  getRequestFormWithCondition: getRequestFormWithCondition,
  createSubmissionForm: createSubmissionForm,
  searchSubmissionForm: searchSubmissionForm,
  updateRequestForm: updateRequestForm
}
